import Vue from 'vue'
import Router from 'vue-router'

// import Home from '../views/Home'

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: 'html',
  routes: [
    {
      path: '/user/login',
      name: 'login',
      component: resolve => {
        // require.ensure 是 Webpack 的特殊语法，用来设置 code-split point
        // （代码分块）
        require.ensure(['../views/Login'], () => {
          resolve(require('../views/Login'))
        })
      }
    },

    {
      path: '/user/register',
      component: resolve => {
        // require.ensure 是 Webpack 的特殊语法，用来设置 code-split point
        // （代码分块）
        require.ensure(['../views/Register'], () => {
          resolve(require('../views/Register'))
        })
      }
    },

    {
      path: '/user/fogot',
      component: resolve => {
        // require.ensure 是 Webpack 的特殊语法，用来设置 code-split point
        // （代码分块）
        require.ensure(['../views/Forgot'], () => {
          resolve(require('../views/Forgot'))
        })
      }
    },

    {
      path: '/profile',
      name: 'profile',
      component: resolve => {
        require.ensure(['../views/Profile'], () => {
          resolve(require('../views/Profile'))
        })
      }
    },
    {
      path: '/sms',
      name: 'sms',
      component: resolve => {
        require.ensure(['../views/Sms'], () => {
          resolve(require('../views/Sms'))
        })
      }
    },
    {
      path: '/reset_pwd',
      name: 'reset_pwd',
      component: resolve => {
        require.ensure(['../views/ResetPwd'], () => {
          resolve(require('../views/ResetPwd'))
        })
      }
    }
  ]
})
